We are trying to print out values that are in a DOORS module, by following the in-links in the DOORS module. The DXL script has to go from the current module, follow the in-links and then print out the values that are associated with that in-link in a different DOORS module. The values that it needs to print out are custom defined values that we have created in our DOORS module. I have tried the following code, but the DXL script gives me the following error:
-R-E- DXL: <Line:27> unknown Object attribute (Attribute3) -I- DXL: execution halted
Atrribute3 does exist in the DOORS module that we are looking in.
The code that we are running is as follows:
// change these lines to display different attributes const string S_ATTR_1 = "Absolute Number" const string S_ATTR_2 = "Object Text" const string S_ATTR_3 = "Attribute3"
Link l Object o
for o in current Module do {
// display in-link information { // process in-links for l in o<- "*" do { Object oTarget = target l
// validate handle if (oTarget != null) { // print attribute values //print S_ATTR_1 "\n" print "Absolute number: " oTarget.S_ATTR_1"\n" print "Requirement number: " oTarget.S_ATTR_2"\n" print "Attribute3: " oTarget.S_ATTR_3"\n"
} print "\n \n" } } print "Next requirement in module \n\n" }
We have done a similar thing for out-links and that works like it should (we follow the out-links to a different DOORS module, find the values that we need and then print them out). For some reason it isn't working on in-links, but does work on out-links.
The DXL script that we are using to do a similar thing, but for out-links is as follows:
// change these lines to display different attributes const string S_ATTR_1 = "Absolute Number" const string S_ATTR_2 = "Object Text" const string S_ATTR_3 = " Attribute3"
Link l Object o
for o in current Module do { // display out-link information { // process out-links for l in all o-> "*" do { Object oTarget = target l
// validate handle if (oTarget != null) { // print attribute values print "Absolute number: " oTarget.S_ATTR_1"\n" print "Requirement number: " oTarget.S_ATTR_2"\n" print " Attribute3: " oTarget.S_ATTR_3"\n" print "\n" } } } print "Next requirement in module \n\n" }
Any ideas/suggestions on how to make the DXL script see the Attribute3 value, when trying to follow the in-links?
Thank you for your help. doors_user2 - Mon Dec 01 13:52:07 EST 2014 |
Re: DOORS DXL in-links script error Well for the in links you might be rather interested in the SOURCE of the link (not the target), arent you? ;-) Another thing to make sure is, that for inlinks all modules need to be opened. We have discussed on the forum save ways to iterate over the links of an object. See for example here: Regards, Mathias
|
Re: DOORS DXL in-links script error Mathias Mamsch - Tue Dec 02 05:56:50 EST 2014 Well for the in links you might be rather interested in the SOURCE of the link (not the target), arent you? ;-) Another thing to make sure is, that for inlinks all modules need to be opened. We have discussed on the forum save ways to iterate over the links of an object. See for example here: Regards, Mathias
Hi, May also be helpful to add a space between the attribute and the "\n" in the print commands. For example, print "Absolute number: " oTarget.S_ATTR_1"\n" Otherwise, DOORS thinks you want attribute S_ATTR_1"\n" instead of S_ATTR_1 and of course, it can't find that attribute. Hope this helps, Greg |
Re: DOORS DXL in-links script error Mathias Mamsch - Tue Dec 02 05:56:50 EST 2014 Well for the in links you might be rather interested in the SOURCE of the link (not the target), arent you? ;-) Another thing to make sure is, that for inlinks all modules need to be opened. We have discussed on the forum save ways to iterate over the links of an object. See for example here: Regards, Mathias
Hi Mathias, We are interested in the Source links. And when we run the scrip, we will be having all the DOORS modules opened at the same time. We will take a look at the discussion forum link that you provided and update our script. Thank you for the help.
|
Re: DOORS DXL in-links script error GregM_dxler - Tue Dec 02 10:38:55 EST 2014 Hi, May also be helpful to add a space between the attribute and the "\n" in the print commands. For example, print "Absolute number: " oTarget.S_ATTR_1"\n" Otherwise, DOORS thinks you want attribute S_ATTR_1"\n" instead of S_ATTR_1 and of course, it can't find that attribute. Hope this helps, Greg Hi Greg, We will also try that in our script. Thank you, |
Re: DOORS DXL in-links script error Mathias Mamsch - Tue Dec 02 05:56:50 EST 2014 Well for the in links you might be rather interested in the SOURCE of the link (not the target), arent you? ;-) Another thing to make sure is, that for inlinks all modules need to be opened. We have discussed on the forum save ways to iterate over the links of an object. See for example here: Regards, Mathias
Yes, change this line:
to:
-Louie |